#ifndef __GLOBAL_DATA_H__
#define __GLOBAL_DATA_H__

#define N 32
#define GOODS_NUM 10
#define STORAGE_NUM 5

union semun {
	int              val;    /* Value for SETVAL */
	struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
	unsigned short  *array;  /* Array for GETALL, SETALL */
	struct seminfo  *__buf;  /* Buffer for IPC_INFO																			(Linux-specific) */
};

struct storage_goods_info
{
	unsigned char goods_type;
	unsigned int goods_count;
};
struct storage_info
{
	unsigned char storage_status;				// 0:open 1:close
	unsigned char led_status;
	unsigned char buzzer_status;
	unsigned char fan_status;
	unsigned char seg_status;
	signed char x;
	signed char y;
	signed char z;
	char samplingTime[20];
	float temperature;
	float temperatureMIN;
	float temperatureMAX;
	float humidity;
	float humidityMIN;
	float humidityMAX;
	float illumination;
	float illuminationMIN;
	float illuminationMAX;
	float battery;
	float adc;
	float adcMIN;
	int warningMask;
	struct storage_goods_info goods_info[GOODS_NUM];
};

struct msg
{
	long type;
	long msgtype;
	unsigned char text[N];
};
struct setEnv
{
	int temMAX;
	int temMIN;
	int humMAX;
	int humMIN;
	int illMAX;
	int illMIN;
};

struct env_info_clien_addr
{
	struct storage_info storage_no[STORAGE_NUM];	
};

struct shm_addr
{
	char cgi_status;
	char qt_status;
	struct env_info_clien_addr rt_status;
};




#endif
